package com.eregg.spring.cloud.movie.controller;

import com.eregg.spring.cloud.movie.bean.User;
import com.eregg.spring.cloud.movie.feign.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.websocket.server.PathParam;
import java.util.List;

/**
 * Created by e on 2017/11/8
 *
 * @author <a href="http://eregg.com">eregg</a>
 */
@RestController
public class MovieController {

    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/user/{id}")
    public User getUserById(@PathVariable Long id){
        User user = userFeignClient.findById(id);
        return user;
    }

}
